<button nz-button nzType="primary" nzSize="small" (click)="showAdd()">添加</button>
<nz-table [nzData]="dataList" [nzFrontPagination]="false" nzSize="small"
          [nzScroll]="{ x: '1200px', y: '480px' }">
  <thead>
  <tr>
    <th>用户名</th>
    <th>邮箱</th>
    <th>用户类型</th>
    <th>最近登录时间</th>
    <th nzRight>操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of dataList">
    <td>{{ data.name }}</td>
    <td> {{ data.email }} </td>
    <td>
      {{ data.userType }}
    </td>
    <td>{{ data.lastLogin| date:'yyyy-MM-dd HH:mm:ss' }}</td>
    <td nzRight>
      <button *ngIf="data.id!=1" nz-popconfirm nzPopconfirmTitle="确定删除该条数据吗？"
              (nzOnConfirm)="deleteConfirm(data.id)"
              (nzOnCancel)="cancel()" nz-button nzType="primary" nzSize="small">删除
      </button>
    </td>
  </tr>
  </tbody>
</nz-table>
<nz-pagination nzShowSizeChanger [(nzPageIndex)]="pageInfo.pageNum" [nzTotal]="pageInfo.total"
               [(nzPageSize)]="pageInfo.pageSize"
               [nzShowTotal]="totalTemplate" (nzPageIndexChange)="getList()"
               (nzPageSizeChange)="getList()"></nz-pagination>

<ng-template #totalTemplate>总共 {{ pageInfo.total }} 条</ng-template>
<br/>
<nz-modal [(nzVisible)]="showAddFlag" nzTitle="添加用户" (nzOnCancel)="handleCancel()" (nzOnOk)="addUser()">
  <ng-container *nzModalContent>
    <form nz-form>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired nzFor="email">用户名</nz-form-label>
        <nz-form-control [nzSpan]="18">
          <input nz-input [(ngModel)]="AddUserInfo.name" name="AddUserInfo.name"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>密码</nz-form-label>
        <nz-form-control [nzSpan]="18">
          <input nz-input type="password" [(ngModel)]="AddUserInfo.password" name="AddUserInfo.password"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>确认密码</nz-form-label>
        <nz-form-control [nzSpan]="18">
          <input nz-input type="password" [(ngModel)]="AddUserInfo.confirmPassword" name="AddUserInfo.confirmPassword"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>邮箱</nz-form-label>
        <nz-form-control [nzSpan]="18">
          <input nz-input [(ngModel)]="AddUserInfo.email" name="AddUserInfo.email"/>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
</nz-modal>

<nz-modal [(nzVisible)]="showUpdateFlag" nzTitle="更新用户" (nzOnCancel)="handleCancel()" (nzOnOk)="update()">
  <ng-container *nzModalContent>
    <form nz-form>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired nzFor="email">标题</nz-form-label>
        <nz-form-control [nzSpan]="24">
          <input nz-input [(ngModel)]="AddUserInfo.name" name="AddUserInfo.name"/>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>日期</nz-form-label>
        <nz-form-control [nzSpan]="24">
          <nz-date-picker [(ngModel)]="AddUserInfo.logDate" name="AddUserInfo.logDate"></nz-date-picker>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>内容</nz-form-label>
        <nz-form-control [nzSpan]="24">
          <textarea rows="6" nz-input [(ngModel)]="AddUserInfo.content" name="AddUserInfo.content"></textarea>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
</nz-modal>

